<html>
<head><meta charset="utf-8"><title>patterns in rust analyzer · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html">patterns in rust analyzer</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="194037734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194037734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Coenen Benjamin <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194037734">(Apr 15 2020 at 14:21)</a>:</h4>
<p>Hi folks ! I have a question about the ids used in ra. For example FunctionId, FileId, ... Is it coming from the entity component system pattern ?</p>



<a name="194038140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194038140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194038140">(Apr 15 2020 at 14:24)</a>:</h4>
<p>I think it's similar. matklad probably didn't arrive at that design from the game engine perspective, but rather from arena allocators, which are often used to reduce the performance impact of dynamic allocations.</p>



<a name="194039072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194039072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Coenen Benjamin <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194039072">(Apr 15 2020 at 14:30)</a>:</h4>
<p>Ok thank you <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> :D Another question haha, is the "interning" pattern also used in ra ? If yes, for which use cases ? With what is called the green nodes ?</p>



<a name="194039815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194039815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194039815">(Apr 15 2020 at 14:35)</a>:</h4>
<p>Green nodes are one place (see also the comment in <a href="https://github.com/rust-analyzer/rowan/blob/master/src/green/builder.rs#L15" title="https://github.com/rust-analyzer/rowan/blob/master/src/green/builder.rs#L15">https://github.com/rust-analyzer/rowan/blob/master/src/green/builder.rs#L15</a>). Not sure about others. I think it also shows up in the <code>salsa</code> integration and with <code>chalk</code> (but there we don't really intern anything)</p>



<a name="194040341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194040341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194040341">(Apr 15 2020 at 14:39)</a>:</h4>
<p>(there's a bit of overlap between ECS, arenas, interning and "data-oriented design", so.. yeah)</p>



<a name="194040513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194040513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Coenen Benjamin <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194040513">(Apr 15 2020 at 14:40)</a>:</h4>
<p>Great, thank you. I have to figure out how green nodes and deduplication are made. I don't fully understand all these parts. Thanks for your help and giving me some insights.</p>



<a name="194043324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/patterns%20in%20rust%20analyzer/near/194043324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/patterns.20in.20rust.20analyzer.html#194043324">(Apr 15 2020 at 14:57)</a>:</h4>
<p>No worries. I'm not terribly familiar with the code myself so I can't tell you much more.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>